package com.wyg.state;

/**
 * @description:
 * @author: WYG
 * @time: 2021/4/7 9:21
 */

public class NoQuarterState implements State{
    GumballMachine gumballMachine;
    public NoQuarterState(GumballMachine gumballMachine) {
        this.gumballMachine = gumballMachine;
    }

    @Override
    public void insertQuarter() {
        System.out.println("您投入了硬币");
        gumballMachine.setState(gumballMachine.getHasQuarterState());
    }

    @Override
    public void ejectQuarter() {
        System.out.println("没有给钱就不能要求退钱");
    }

    @Override
    public void turnCrank() {
        System.out.println("没有给钱无法转动糖果机状态售出糖果");
    }

    @Override
    public void dispense() {
        System.out.println("你必须先投币");
    }
}
